﻿//-----------------------------------------------------------------------------
// <copyright file="IFocusSuggested.cs" company="William E. Kempf">
//     Copyright (c) William E. Kempf.
// </copyright>
//-----------------------------------------------------------------------------

namespace Onyx.Windows
{
    /// <summary>
    /// Defines an object that can set the focus to an element.
    /// </summary>
    public interface IFocusSuggested
    {
        /// <summary>
        /// Sets the focus to an element within the "view".
        /// </summary>
        /// <param name="key">The key used to locate the element within the "view".</param>
        /// <returns>
        /// <see langword="true"/> if the element with the specified <paramref name="key"/> was found and focus was
        /// succesfully set to it; otherwise <see langword="false"/>.
        /// </returns>
        bool SetFocus(string key);

        /// <summary>
        /// Sets the focus to an element within the "view".
        /// </summary>
        /// <param name="key">The key used to locate the element within the "view".</param>
        /// <param name="selectAll"><see langword="true"/> if all of the contents of the selected element should be
        /// selected.</param>
        /// <returns>
        /// <see langword="true"/> if the element with the specified <paramref name="key"/> was found and focus was
        /// succesfully set to it; otherwise <see langword="false"/>.
        /// </returns>
        bool SetFocus(string key, bool selectAll);
    }
}
